package com.ruoyi.gybj.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.gybj.mapper.MessageStrategyMapper;
import com.ruoyi.gybj.domain.MessageStrategy;
import com.ruoyi.gybj.service.IMessageStrategyService;

/**
 * 消息策略Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-19
 */
@Service
public class MessageStrategyServiceImpl implements IMessageStrategyService 
{
    @Autowired
    private MessageStrategyMapper messageStrategyMapper;

    /**
     * 查询消息策略
     * 
     * @param id 消息策略主键
     * @return 消息策略
     */
    @Override
    public MessageStrategy selectMessageStrategyById(Long id)
    {
        return messageStrategyMapper.selectMessageStrategyById(id);
    }

    /**
     * 查询消息策略列表
     * 
     * @param messageStrategy 消息策略
     * @return 消息策略
     */
    @Override
    public List<MessageStrategy> selectMessageStrategyList(MessageStrategy messageStrategy)
    {
        return messageStrategyMapper.selectMessageStrategyList(messageStrategy);
    }

    /**
     * 新增消息策略
     * 
     * @param messageStrategy 消息策略
     * @return 结果
     */
    @Override
    public int insertMessageStrategy(MessageStrategy messageStrategy)
    {
        messageStrategy.setCreateTime(DateUtils.getNowDate());
        return messageStrategyMapper.insertMessageStrategy(messageStrategy);
    }

    /**
     * 修改消息策略
     * 
     * @param messageStrategy 消息策略
     * @return 结果
     */
    @Override
    public int updateMessageStrategy(MessageStrategy messageStrategy)
    {
        messageStrategy.setUpdateTime(DateUtils.getNowDate());
        return messageStrategyMapper.updateMessageStrategy(messageStrategy);
    }

    /**
     * 批量删除消息策略
     * 
     * @param ids 需要删除的消息策略主键
     * @return 结果
     */
    @Override
    public int deleteMessageStrategyByIds(Long[] ids)
    {
        return messageStrategyMapper.deleteMessageStrategyByIds(ids);
    }

    /**
     * 删除消息策略信息
     * 
     * @param id 消息策略主键
     * @return 结果
     */
    @Override
    public int deleteMessageStrategyById(Long id)
    {
        return messageStrategyMapper.deleteMessageStrategyById(id);
    }
}
